#pragma warning disable 0618
using System;
using System.Collections.Generic;
using Table.DataModel;
namespace Table.Dao
{
    public class TableDailyActiveDao:DaoBase<TableDailyActive>
    {
        public override string GetFileName()
        {
            return "TableDailyActive.csv";
        }
        public override void BuildIndex()
        {
            if (cacheList != null)
            {
                cachePrimaryInt = new Dictionary<int, TableDailyActive>(cacheList.Count);
            }
            base.BuildIndex();
        }
        public override void AddPrimaryIndex(TableDailyActive model)
        {
            #if UNITY_EDITOR
            if(cachePrimaryInt.ContainsKey(model.dailyActiveModule)) UnityEngine.Debug.LogError("数据表id重复:TableDailyActive->id: " + model.dailyActiveModule);
            #endif
            cachePrimaryInt[model.dailyActiveModule] = model;
        }
        protected override TableDailyActive ParseRowData(string[] rowData)
        {
            TableDailyActive data = new TableDailyActive();
            if (!string.IsNullOrEmpty(rowData[0]))
            {
                data.dailyActiveModule = int.Parse(rowData[0]);
            }
            if (!string.IsNullOrEmpty(rowData[1]))
            {
                data.isFirst = int.Parse(rowData[1]);
            }
            if (!string.IsNullOrEmpty(rowData[2]))
            {
                data.types = string.Intern(rowData[2]);
            }
            if (!string.IsNullOrEmpty(rowData[3]))
            {
                data.maxActive = int.Parse(rowData[3]);
            }
            if (!string.IsNullOrEmpty(rowData[4]))
            {
                data.addActive = int.Parse(rowData[4]);
            }
            if (!string.IsNullOrEmpty(rowData[5]))
            {
                data.sort = int.Parse(rowData[5]);
            }
            if (!string.IsNullOrEmpty(rowData[6]))
            {
                data.showReward = rowData[6];
            }
            if (!string.IsNullOrEmpty(rowData[7]))
            {
                data.bgRawImage = string.Intern(rowData[7]);
            }
            if (!string.IsNullOrEmpty(rowData[8]))
            {
                data.titleImage = rowData[8];
            }
            return data;
        }
    }
}
